﻿using System;
using System.Reflection;

namespace MugenInjection.Interface
{
    /// <summary>
    /// Represents the parameter for the <see cref="IInjector"/>.
    /// </summary>
    public interface IInjectionParameter : IEquatable<IInjectionParameter>
    {
        /// <summary>
        /// Gets the specified parameter name.
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Gets the specified parameter <see cref="Type"/>.
        /// </summary>
        Type ParameterType { get; }

        /// <summary>
        /// Gets the specified parameter <see cref="MemberTypes"/>.
        /// </summary>
        MemberTypes MemberType { get; }

        /// <summary>
        /// Determines whether the specified request can be resolved.
        /// </summary>
        /// <param name="memberInfo">The specified <see cref="MemberInfo"/></param>
        /// <param name="parameter">The specified <see cref="ParameterInfo"/> </param>
        /// <returns><c>True</c> if the specified request has been resolved; otherwise, <c>false</c>.</returns>
        bool CanResolve(MemberInfo memberInfo, ParameterInfo parameter);


        /// <summary>
        /// Gets parameter value for specified <see cref="IParameterContext"/>.
        /// </summary>
        /// <param name="parameterContext">The specified <see cref="IParameterContext"/>.</param>
        /// <returns>An instance of the parameter value.</returns>
        object GetValue(IParameterContext parameterContext);
    }
}